<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge;">
<title>Launcher</title>
<link rel="stylesheet" href="/public/launcher/css/core.css">
<link rel="stylesheet" href="/public/launcher/css/buttons-<%= locale %>.css">
<script type="text/javascript" src="/public/launcher/js/jquery-1.11.1.min.js"></script>
<script>
	var startFileChekingString = "<%= __('Start files checking?') %>";
	var accountBlockedString = "<%= __('Account blocked. Please contact support.') %>";

	var PATCH_NO_CHECK = /^true$/i.test("<%= patchNoCheck %>");
	var PATCH_URL = "<%= patchUrl %>";
	var REGION = "<%= region %>";
	var PATCH_INFO_STRINGS = {
		"0": "<%= __('Preparing...') %>",
		"1": "<%= __('Download') %>",
		"2": "<%= __('Unpack') %>",
		"3": "<%= __('Patch') %>",
		"4": "<%= __('Check') %>",
		"5": "<%= __('Delete') %>",
		"6": "<%= __('Check') %>",
		"11": "<%= __('Making patch list...') %>"
	};

	document.onkeydown = function() {
		if (event.keyCode == 116) {
			event.keyCode = 2;
			return false;
		} else if (event.ctrlKey && (event.keyCode == 78 || event.keyCode == 82)) {
			return false;
		}
	};
</script>
<script type="text/javascript" src="/public/launcher/js/launcher-util.js"></script>
<script type="text/javascript" src="/public/launcher/js/launcher-errors.js"></script>
<script type="text/javascript" src="/public/launcher/js/launcher.js"></script>
<style type="text/css">
	html { overflow: hidden; padding: 0; margin: 0; }
</style>
</head>
<body oncontextmenu="return false" ondragstart="return false" onselectstart="return false">
	<div class="wrap" style="display: none;" id="launcherMain">
		<div class="header">
			<div class="logo"><img src="/public/launcher/images/logo.png"></div>
			<!--/logo-->
			<div class="col"></div>
			<!--/col-->
		</div>
		<!--/header-->
		<div class="content">
			<div class="notice">
				<h3><%= __("Welcome") %>, <span id="userName""></span>! <a href="#" class="btn-logout" onclick="loginIFrame.logout();"></a></h3>
				<div id="qaBox" class="qa-box" style="display: none;">
					<fieldset>
						<legend>QA Operations Menu</legend>
						<table>
							<tr><td>Disable file check</td><td><input type="checkbox" id="qaModeCheck" checked></td></tr>
							<tr><td>Client language</td><td><select id="qaRegion">
							<% Object.keys(regions).forEach(key => { %>
								<option value="<%= key %>"><%= __(regions[key]) %></option>
							<% }) %>
							</select></td></tr>
						</table>
					</fieldset>
					<a href="#" id="qaHide" class="qa-hide">Hide block</a>
				</div>
			</div>
			<!--/notice-->
			<div class="ad"></div>
			<!--/ad-->
			<div class="bottom">
				<div class="progress">
					<h3></h3>
					<div class="total">
						<div class="tit"><%= __("total") %></div>
						<div class="progress-bar progressAll">
							<div class="progress-bar-complete" id="progressBar2" style="width: 30%;"></div>
							<span class="file-name" id="totalText"></span>
						</div>
					</div>
					<div class="now">
						<div class="tit"><%= __("now") %></div>
						<div class="progress-bar progressNow">
							<div class="progress-bar-complete" id="progressBar1" style="width: 80%;"></div>
							<span class="file-name" id="fileName"></span>
						</div>
					</div>&nbsp;
				</div>
				<!--/progress--> 
				<div class="check">
					<% if (!/^true$/i.test(patchNoCheck)) { %>
					<button class="btn-check" onclick="if (confirm(startFileChekingString)) Launcher.filesCheck();">Repair</button>&nbsp;
					<% } %>
				</div>
				<!--/check-->
				<div class="gamestart">
					<button class="btn-gamestart btn" id="playButton" onclick="Launcher.onButtonClick();">Play</button>
				</div>
				<!--/gamestart-->
			</div>
			<!--/bottom-->
		</div>
		<!--/content-->
		<div class="footer">&copy; <%= new Date().getFullYear() %> <%= brandName %>. All Rights Reserved.</div>
		<!--/footer-->
		<button class="btn-close" onclick="Launcher.sendCommand('close');">Close</button>
	</div>
	<!--/wrap-->
	<div id="loginScreen" class="modalScreen">
		<iframe src="/tera/LauncherLoginForm" id="loginIFrame" name="loginIFrame"></iframe>
	</div>
</body>
</html>